#include<iostream>
#include<fstream>
#include "bieuthuc.h"
#include "DonThuc.h"
#include "HangSo.h"
#include "BieuThucTong.h"
#include "BieuThucTich.h"
#include "BieuThucChia.h"
#include "Test.h"
using namespace std;


void main()
{
	//BieuThuc *a = new DonThuc();
	BieuThuc *a;
	int i =0;
	float *chuoi = new float[];		
	ifstream filetxt ("input.txt");
    if(! filetxt.is_open())
    {
        cout<<"Khong the mo file.\n";
        return ;
    }
    else 
	{
        float temp;		
		while(!filetxt.eof())
		{
			filetxt>>temp;
			chuoi[i]=temp;			
			i++;
		}
	}
	filetxt.close();

	//delete []a;

	int h=0;
	Test df;
	BieuThuc * bt = df.taoBieuThuc(chuoi, h);
	ofstream f("output.txt");
	float str = bt->tinhGiaTri(df.x);
	f<<bt->bieuDien();
	f<<str;

	system("Pause");
	return;

	
}
